import request from "../axios";

export default {
  /**
   * 初始化
   *
   * @param currentPage
   * @param pageSize
   * @param nickname
   * @returns {AxiosPromise}
   */
  loadMember(currentPage, pageSize, nickname) {
    return request({
      url: `/member/queryList/${currentPage}/${pageSize}`,
      method: 'GET',
      params: {nickname}
    })
  },
  /* 根据id删除单行 */
  handleDeleteRow(memberId) {
    return request({
      url: `/member/${memberId}`,
      method: 'delete'
    })
  },
  /* 根据id批量删除 */
  deleteByIdS(id) {
    return request({
      url: '/member/deleteListById',
      method: 'delete',
      data: id
    })
  },
  /* 插入 */
  add(member) {
    return request({
      url: '/member/add',
      method: 'post',
      data: member
    })
  },

  /* 更新 */
  update(member) {
    return request({
      url: '/member/update',
      method: 'post',
      data: member
    })
  },

  /* 重置密码 */
  reset(id) {
    return request({
      url: `/member/${id}`,
      method: 'post'
    })
  }
}
